const common_vendor = require("../static/js_sdk/js-base64/base64.js");

function getToken() {
  const token = common_vendor.index.getStorageSync("token").user_Token || "";
  const base64_token = common_vendor.gBase64.encode(token + ":");
  return "Basic " + base64_token;
}
const basurl ='https://meituan.thexxdd.cn/api';
const  request =(params)=>{
 return new Promise((resolve,reject)=>{
  uni.request({
   ...params,
   url:basurl + params.url,
   method:params.method || "get",
   data:params.data || {},
// header: { Authorization: },

   success:(res)=>{
    resolve(res)
	// console.log(getStorageSync("token").user_Token);
   },
   fail:(err)=>{
    reject(err)
   }
  })
 })
}
export default  request
